from openpyxl import load_workbook

wb = load_workbook("styletable/styletable.xlsx")
# ws = wb['分类表']
# rows_data = list(ws.rows)[1:]
# keys = ['l1_id', 'l1_name', 'l2_id', 'l2_name', 'l3_id', 'l3_name']
# all_row_dict = []
# for row in rows_data:
#     row_data = [cell.value for cell in row]
#     row_dict = dict(zip(keys,row_data))
#     print(row_dict)
#     all_row_dict.append(row_dict)
# print(all_row_dict)

ws = wb['需填写']
rows = list(ws.rows)[1:]
goods_class_map = {}
for row in rows:
    if row[1].value:
        goods_class_map[row[0].value] = row[1].value
print(goods_class_map)
